import { Command, Positional } from 'nestjs-command';
import { Injectable } from '@nestjs/common';
import { DatabaseSeeder } from './init.seed';

@Injectable()
export class SeedCommand {
  constructor(private readonly seeder: DatabaseSeeder) { }

  @Command({
    command: 'seed',
    describe: 'Seed the database with initial data',
  })
  async seed() {
    try {
      await this.seeder.seed();
      console.log('Database seeded successfully');
    } catch (error) {
      console.error('Error seeding database:', error);
      throw error;
    }
  }
} 